<template>
	<view class="wh100 swiper-tem">
		<swiper class="wh100" @change="change" autoplay circular :interval='2000'>
			<swiper-item v-for="(item, index) in list" :key="index" @click="itemTap(item,index)">
				<view class="wh100">
					<image class="wh100 radius" :src="item.cover_imgurl"></image>
				</view>
			</swiper-item>
		</swiper>
		<view class="pages-box"> {{current+1}} / {{list.length}} </view>
	</view>
</template>

<script>
	export default {
		props: ['list'],
		data() {
			return {
				current: 0,
			}
		},

		methods: {
			change(e) {
				this.current = e.detail.current;
			},
			itemTap(item,index){
				if(item.url){
					uni.navigateTo({
						url:item.url
					})
					// uni.switchTab({
					// 	url:item.url
					// })
				}
				console.log(item,index)
			}
		}
	}
</script>

<style scoped lang="scss">
	.swiper-tem {
		width: 690rpx;
		height:320rpx;
		position: relative;
		border-radius: 48rpx;
		overflow: hidden;
	}
	.radius{
		border-radius: 48rpx;
		overflow: hidden;
		box-sizing: border-box;
	}
	.pages-box{
		width: 80rpx;
		height: 40rpx;
		position: absolute;
		bottom: 20rpx;
		right:26rpx;
		background: #FFFFFF;
		border-radius: 21rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		
		font-size: 26rpx;
		font-weight: bold;
		color: #884FFF;
	}
</style>